<template>
	<view class="all">
		<button type="primary" @click="link('computerRoom/computerRoom')">机房管理</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		onLoad() {
			var initialization=uni.getStorageSync("initialization")
			if(initialization==undefined||initialization==''){
				uni.showLoading({
					title:"初始化数据中"
				})
				const computerRoom={
					temperature:30,
					airConditionerSwitch:false,
					equipmentList:[]
				}
				uni.setStorageSync("computerRoom",JSON.stringify(computerRoom))//初始化机房数据
				const passwordBooks=[]
				uni.setStorageSync("passwordBooks",JSON.stringify(passwordBooks))//初始化密码本
				uni.setStorageSync("initialization",JSON.stringify(true))//完成初始化
				uni.hideLoading()
			}
		},
		methods: {
			link(url){
				uni.navigateTo({
					animationType:'zoom-out',
					url:url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.all{
	margin: 0;
	padding: 0;
}
</style>
